package cn.xiuxius.askbox.aspect;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@Aspect
public class ControllerLoggerAspect {

    @Around("execution(* cn.xiuxius.askbox.controller..*.*(..))")
    public Object printControllerLog(ProceedingJoinPoint joinPoint) throws Throwable {
        log.debug("[Controller] {}.{}", joinPoint.getSignature().getDeclaringTypeName(), joinPoint.getSignature().getName());
        return joinPoint.proceed();
    }
}
